<template>
	<view>
		<view class="new_item" v-for="item in newList" :key="item.id" @click="handleGoDatail(item.id)">
			<image :src="item.img_url"></image>
			<view class="new_title">
				<text>{{item.title}}</text>
				<view class="new_bottom">
					<view class="new_time">发布时间：{{item.add_time | handleTime}}</view>
					<view class="new_number">浏览：{{item.click}}</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		name:"new",
		data() {
			return {
				
			};
		},
		props:["newList"],
		filters:{
			handleTime(date){
				return date.slice(0,date.indexOf('T'))
			}
		},
		methods:{
			handleGoDatail(id){
				this.$emit('handleGoDatail',id)
			}
		}
	}
</script>

<style lang="less">
.new_item{
		width: 750rpx;
		display: flex;
		padding: 20rpx;
		border-bottom: 1rpx solid #EEEEEE;
		image{
			min-width: 200rpx;
			max-width: 200rpx;
			height: 150rpx;
		}
		.new_title{
			margin-left: 15rpx;
			display: flex;
			flex-direction: column;
			justify-content: space-between;
			padding: 0 30rpx;
			text{
				font-size: 30rpx;
				// 自动换行
				word-break: break-all;
			}
			.new_bottom{
				font-size: 24rpx;
				display: flex;
				.new_time{}
				.new_number{
					margin-left: 100rpx;
				}
			}
		}
	}
</style>
